package com.caesar.exer2;

/**
 * @author caesar
 * @date 2025/7/21
 * @Description:
 * @apiNote
 */
public class ListAddThread extends Thread{
    private final SharedList sharedList;
    private final int iterations;

    public ListAddThread(SharedList sharedList, int iterations) {
        this.sharedList = sharedList;
        this.iterations = iterations;
    }

    @Override
    public void run() {
        for(int i = 0; i < iterations; i++){
            sharedList.addElement(i);
        }
    }
}
